# Forked from Alpine to remove eudev dependency

pkgname=multipath-tools
pkgver=99990.10.0
_pkgver=0.10.0
pkgrel=0
pkgdesc="Device Mapper Multipathing Driver"
url="http://christophe.varoqui.free.fr/"
arch="all"
license="LGPL-2.0-only"
depends="device-mapper"
makedepends="
	json-c-dev
	libaio-dev
	lvm2-dev
	ncurses-dev
	perl
	readline-dev
	systemd-dev
	userspace-rcu-dev
	util-linux-dev
	"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$_pkgver.tar.gz::https://github.com/opensvc/multipath-tools/archive/refs/tags/$_pkgver.tar.gz
	multipath-tools.conf
	multipath.initd
	multipathd.initd
	multipathd.confd
	0001-Disable-O2.patch
	fix-basename.patch
	"
options="!check"
builddir="$srcdir"/multipath-tools-"$_pkgver"

build() {
	make WARN_ONLY=1 prefix="/usr" \
		sysconfdir="/etc" \
		configdir="/etc/multipath/conf.d" \
		mandir="/usr/share/man" \
		infodir="/usr/share/info"
}

package() {
	make prefix="/usr" SYSTEMDPATH="/usr/lib" LIB=lib DESTDIR="$pkgdir" install

	install -D -m644 "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/multipath.conf
	install -D -m755 "$srcdir"/multipathd.initd \
		"$pkgdir"/etc/init.d/multipathd
	install -D -m644 "$srcdir"/multipathd.confd \
		"$pkgdir"/etc/conf.d/multipathd
	install -D -m755 "$srcdir"/multipath.initd \
		"$pkgdir"/etc/init.d/multipath
	install -D -m644 README.md \
		"$pkgdir"/usr/share/doc/$pkgname/README.md
}

sha512sums="
8f545609fa20df7547428f2929571dc0df87c17d9f61f11aad3559446c2e94755e18b1c4b3780b3de92ec2cbc450939ca15a9d6c95551eee4084064d83874b2d  multipath-tools-0.10.0.tar.gz
e81462b22c0cbc92ea935d7544b9f9a0c4ccbcf13f3bc03dadf6de96407c9cf49964c9bbf02f12a134e1255c66421c6fde39d54b15eef975e8df81bdc88b2213  multipath-tools.conf
6176a4ed32711ff8e417a58ca0cad8279d46ba98ec40095dbdb1035c49c0f82b06b5affbe2b79c5f2020b215ebe31ebeb408509dc810f5d21eb757e88be8c99f  multipath.initd
17853ca127259e129bbd61f24a830777d5b6d69f6500313fa62a0e0773de73387ce2c3a58a93a6182ee3d4891d1ec5fc2322cb674e787b326ef9cd8dcff5cbab  multipathd.initd
2adc2b8322645fec8763a662614b5682294f81dc0f1b9cacace5e5ea62125aa80f4874c1b10f11619e79871087846a946f7a383c22953ca1fbaeb9ea021c5114  multipathd.confd
12efc27a7fd492834dd1d86d67faa1a6884142779f5452ada5373d893cd441572e07f9f9ea441dd92d49274ccc21a53d70f2af8a49c63060ff7490b93e3cb58d  0001-Disable-O2.patch
3f65a2006c03ba168eb3fcec537042ae9e0ddbcab48a051970fcc477bd88b2eeb16db79c9f06d4fc7b7e06411d46e159b7d13d2fe9613ba5be1ed68d9e66e54c  fix-basename.patch
"
